#ifndef BITFIELD
#define BITFIELD

#define BUFFSIZE 8

typedef struct _bitiob {
  int fd;
  char *base;
  char *ptr;
  int count;
} *bf_stream;

bf_stream bf_stream_new (int fd);
void bf_fillbuff (bf_stream bf);
void bf_flush (bf_stream bf);
void putbit (bf_stream bf, int b);
int getbit (bf_stream bf);

#endif
